// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by sidekick. DO NOT EDIT.

/// A dyn-compatible, crate-private version of [super::LicenseManagementService].
#[async_trait::async_trait]
pub trait LicenseManagementService: std::fmt::Debug + Send + Sync {
    async fn get_license_pool(
        &self,
        req: crate::model::GetLicensePoolRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::LicensePool>>;

    async fn update_license_pool(
        &self,
        req: crate::model::UpdateLicensePoolRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::LicensePool>>;

    async fn assign(
        &self,
        req: crate::model::AssignRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::AssignResponse>>;

    async fn unassign(
        &self,
        req: crate::model::UnassignRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::UnassignResponse>>;

    async fn enumerate_licensed_users(
        &self,
        req: crate::model::EnumerateLicensedUsersRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::EnumerateLicensedUsersResponse>>;

    async fn get_operation(
        &self,
        req: longrunning::model::GetOperationRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<longrunning::model::Operation>>;
}

/// All implementations of [super::LicenseManagementService] also implement [LicenseManagementService].
#[async_trait::async_trait]
impl<T: super::LicenseManagementService> LicenseManagementService for T {
    /// Forwards the call to the implementation provided by `T`.
    async fn get_license_pool(
        &self,
        req: crate::model::GetLicensePoolRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::LicensePool>> {
        T::get_license_pool(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn update_license_pool(
        &self,
        req: crate::model::UpdateLicensePoolRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::LicensePool>> {
        T::update_license_pool(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn assign(
        &self,
        req: crate::model::AssignRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::AssignResponse>> {
        T::assign(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn unassign(
        &self,
        req: crate::model::UnassignRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::UnassignResponse>> {
        T::unassign(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn enumerate_licensed_users(
        &self,
        req: crate::model::EnumerateLicensedUsersRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::EnumerateLicensedUsersResponse>> {
        T::enumerate_licensed_users(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn get_operation(
        &self,
        req: longrunning::model::GetOperationRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<longrunning::model::Operation>> {
        T::get_operation(self, req, options).await
    }
}

/// A dyn-compatible, crate-private version of [super::ConsumerProcurementService].
#[async_trait::async_trait]
pub trait ConsumerProcurementService: std::fmt::Debug + Send + Sync {
    async fn place_order(
        &self,
        req: crate::model::PlaceOrderRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<longrunning::model::Operation>>;

    async fn get_order(
        &self,
        req: crate::model::GetOrderRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::Order>>;

    async fn list_orders(
        &self,
        req: crate::model::ListOrdersRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::ListOrdersResponse>>;

    async fn modify_order(
        &self,
        req: crate::model::ModifyOrderRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<longrunning::model::Operation>>;

    async fn cancel_order(
        &self,
        req: crate::model::CancelOrderRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<longrunning::model::Operation>>;

    async fn get_operation(
        &self,
        req: longrunning::model::GetOperationRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<longrunning::model::Operation>>;

    fn get_polling_error_policy(
        &self,
        options: &gax::options::RequestOptions,
    ) -> std::sync::Arc<dyn gax::polling_error_policy::PollingErrorPolicy>;

    fn get_polling_backoff_policy(
        &self,
        options: &gax::options::RequestOptions,
    ) -> std::sync::Arc<dyn gax::polling_backoff_policy::PollingBackoffPolicy>;
}

/// All implementations of [super::ConsumerProcurementService] also implement [ConsumerProcurementService].
#[async_trait::async_trait]
impl<T: super::ConsumerProcurementService> ConsumerProcurementService for T {
    /// Forwards the call to the implementation provided by `T`.
    async fn place_order(
        &self,
        req: crate::model::PlaceOrderRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<longrunning::model::Operation>> {
        T::place_order(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn get_order(
        &self,
        req: crate::model::GetOrderRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::Order>> {
        T::get_order(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn list_orders(
        &self,
        req: crate::model::ListOrdersRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::ListOrdersResponse>> {
        T::list_orders(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn modify_order(
        &self,
        req: crate::model::ModifyOrderRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<longrunning::model::Operation>> {
        T::modify_order(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn cancel_order(
        &self,
        req: crate::model::CancelOrderRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<longrunning::model::Operation>> {
        T::cancel_order(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn get_operation(
        &self,
        req: longrunning::model::GetOperationRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<longrunning::model::Operation>> {
        T::get_operation(self, req, options).await
    }

    fn get_polling_error_policy(
        &self,
        options: &gax::options::RequestOptions,
    ) -> std::sync::Arc<dyn gax::polling_error_policy::PollingErrorPolicy> {
        T::get_polling_error_policy(self, options)
    }

    fn get_polling_backoff_policy(
        &self,
        options: &gax::options::RequestOptions,
    ) -> std::sync::Arc<dyn gax::polling_backoff_policy::PollingBackoffPolicy> {
        T::get_polling_backoff_policy(self, options)
    }
}
